/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.sonatype.mavenbook.weather;

import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import org.apache.log4j.Logger;

/**
 *
 * @author JHS-Home
 */
public class YahooRetriever {
    private static Logger log = Logger.getLogger(YahooRetriever.class);
    // logger make in class , and make Logger using the class
    public InputStream retrieve(String zipcode) throws Exception {
        log.info("Retrieving Weather Data ");
        String url = "http://weather.yahooapis.com/forecastrss?p=" + zipcode;
        URLConnection conn = new URL(url).openConnection();
        return conn.getInputStream();
    }
}
